var hoverZoomPlugins = hoverZoomPlugins || [];
hoverZoomPlugins.push( {
	name: 'TibiaSpace',
	version: '0.1',
	prepareImgLinks: function(callback) {
		var res = [];
		$("a img[src*=thumb.png]").each(function() {
			var link = $(this).parents('a:eq(0)');
			if (link) {
				$(link).data('hoverZoomSrc', [this.src.replace(/thumb\.png$/i, '.png')]);
				var parent = $(link).parents('tr:eq(0)');
				var title = $(parent).find('a b:eq(0)');
				if ($(title).length)
					$(link).data('hoverZoomCaption', title.html());
				else
				{
					if (title = $(link).attr('groupname'));
					else if (title = $(link).attr('charname'));
					$(link).data('hoverZoomCaption', title);
				}
				res.push(link);
			}
		});
		$("a img[src*=tmb.]").each(function() {
			var link = $(this).parents('a:eq(0)');
			if (link) {
				$(link).data('hoverZoomSrc', [this.src.replace(/tmb\.(.*?)$/i, '.$1')]);
				$(link).data('hoverZoomCaption', this.alt);
				res.push(link);
			}
		});
		callback($(res));
	}
});